<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2025/5/26
  Time: 22:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>添加新用户</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link type="text/css" rel="stylesheet" href="css/index.css">
    <link type="text/css" rel="stylesheet" href="css/base.css">
    <script type="text/javascript" src="js/user.js" defer></script>
</head>
<body>
    <div class="container">
        <jsp:include page="header.jsp"></jsp:include>
        <div class="main user-add">
            <h2>添加新用户</h2>
            <form class="user-add-form" action="/admin/admin_add" method="post" enctype="multipart/form-data">

                <div class="user-add-form-group">
                    <label for="avatar">头像</label>
                    <div class="avatar-preview">
                        <img id="avatar-img" src="/picture/avatar.png" alt="用户头像">
                    </div>
                    <input type="file" id="avatar" name="avatar" accept="image/*">
                </div>

                <div class="user-add-form-group">
                    <label for="nickname">昵称</label>
                    <input type="text" id="nickname" name="nickname" placeholder="请输入昵称">
                    <div class="error" id="nicknameError"></div>
                </div>

                <div class="user-add-form-group">
                    <label for="username">用户名</label>
                    <input type="text" id="username" name="username" placeholder="请输入用户名">
                    <div class="error" id="usernameError"></div>
                </div>

                <div class="user-add-form-group">
                    <label for="email">邮箱</label>
                    <input type="email" id="email" name="email" placeholder="请输入邮箱">
                    <div class="error" id="emailError"></div>
                </div>

                <div class="user-add-form-group">
                    <label for="password">密码</label>
                    <input type="password" id="password" name="password" placeholder="请输入密码">
                    <div class="error" id="passwordError"></div>
                </div>

                <div class="user-add-form-group">
                    <label>是否为管理员</label>
                    <input type="radio" name="is_admin" value="1"><label>是</label>
                    <input type="radio" name="is_admin" value="0" checked><label>否</label>
                </div>

                <button type="submit" class="final-button">添加用户</button>
            </form>
        </div>
    </div>
</body>
</html>
